import streamlit as st
import tools.mysql as tm
import tools.llm as tl


st.write("新增笔记")

st.text_input("标题", key="title")
st.text_area("内容", key="content", height=200, max_chars=500)
st.button("保存", key="save")

if st.session_state.get("save"):
    title = st.session_state.get("title")
    content = st.session_state.get("content")
    tm.add_note(title, content)

    st.write("保存成功")

